﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Navigant.Infrastructure.DomainBase
{
    public class Attachment
    {
        private byte[] content;
        private string fileName;
        private string originalUrl;

        public Attachment(byte[] content, string fileName) 
            : this(content, fileName, string.Empty)
        {
        }

        public Attachment(byte[] content, string fileName, string originalUrl)
        {
            if (content == null || content.Length == 0)
            {
                throw new ArgumentException("Must have content for the Attachment", "content");
            }
            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentException("The Attachment must have a valid file name", "fileName");
            }
            this.content = content;
            this.fileName = fileName;
            this.originalUrl = originalUrl;
        }

        public byte[] Content
        {
            get { return this.content; }
        }

        public string FileName
        {
            get { return this.fileName; }
        }

        public string OriginalUrl
        {
            get { return this.originalUrl; }
        }
    }
}
